package com.vrms.app.service.impl;

import com.vrms.app.dao.ProblemDao;
import com.vrms.app.entity.Problem;
import com.vrms.app.service.ProblemService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class ProblemServiceImpl implements ProblemService {
    @Resource
    private ProblemDao problemDao;

    @Override
    public List<Problem> listPage(int page, int size, String type) {
        return problemDao.listPage((page-1)*size,size,type);
    }

    @Override
    public int count(String type) {
        return problemDao.count(type);
    }

    @Override
    public boolean save(Problem problem) {
        return problemDao.save(problem)>0;
    }

    @Override
    public boolean update(Problem problem) {
        return problemDao.update(problem)>0;
    }

    @Override
    public boolean remove(int id) {
        return problemDao.remove(id)>0;
    }

    @Override
    public List<Problem> list() {
        return problemDao.list();
    }
}
